import React, { Component } from 'react'
import FromContainer from './FromContainer'

export default class From extends Component {

    constructor(){
        super();
        this.state={
            name:""
        }
    }
    render() {
        return (
            <FromContainer>
                <input type="text" value={this.state.name} 
                onChange={(e)=>{
                    this.setState({
                        name:e.target.value
                    })
                }}
                className="wrap"/>
                <button onClick={()=>this.props.search(this.state.name)}>查询</button>
                <button onClick={()=>this.props.add(this.state.name)}>添加</button>
            </FromContainer>
        )
    }
}
